#ifndef COURSE_H
#define COURSE_H

#include <QString>
#include <QVector>
#include <QDate>
#include <QDataStream>
#include "ClassSection.h"
#include "Assignment.h"
#include "Exam.h"
#include "DateRange.h"
#include "CourseOutline.h"

#include <QDebug>

using namespace std;

class Course
{
public:
    Course();
    Course(QString name, QString code, int numberOfSections);
    Course(QString name, QString code, int maxSections, QVector<Course> prereqList, QVector<Course> antireqList,
           QVector<ClassSection>classSectionList, QVector<Exam> examList, QVector<Assignment> assignmentList,
           DateRange duration, CourseOutline outline);

    QString getName() const;
    QString getName();
    QString getCode() const;
    QString getCode();
    int getMaxSections() const;
    QVector<Course> getPrereqList() const;
    QVector<Course> getAntireqList() const;
    QVector<ClassSection> getClassSection() const;
    QVector<Exam> getExamList() const;
    QVector<Assignment> getAssignmentList() const;
    DateRange getDuration() const;
    CourseOutline getOutline() const;

    int getNumberOfSections() const;

    void setName(QString newName);
    void setCode(QString newCode);
    void setDuration(DateRange duration);
    void setOutline(CourseOutline outline);
    void setOutline(CourseOutline* outline);
    void addPrereq(Course course);
    void addAntireq(Course course);
    void addClassSection(ClassSection section);
    //void addClassSectionAt(ClassSection section, int index);
    void addExam(Exam exam);
    void addClassSectionAt(ClassSection section, int index);
    void addAssignment(Assignment assignment);
    Course removePrereq(QString courseCode);
    Course removeAntireq(QString courseCode);
    ClassSection removeClassSection(int sectionNumber);
    Exam removeExam(int examNumber);
    Assignment removeAssignment(int assignmentNumber);

    //need so admin can make changes
    QVector<Course> getAntireq();
    QVector<Course> getPrereq();
    QVector<ClassSection> *getClaSect();

    void setNumberOfSections(int newNum);
private:
    QString name;
    QString code;
    int maxSections;
    QVector<Course> prereqList;
    QVector<Course> antireqList;
    QVector<ClassSection> classSectionList;
    QVector<Exam> examList;
    QVector<Assignment> assignmentList;
    DateRange duration;
    CourseOutline outline;
    int numberOfSections;

};

QDataStream &operator<<(QDataStream &out, const Course &data);
QDataStream &operator>>(QDataStream &in, Course &data);

#endif // COURSE_H
